<!--Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html lang="en">
<head>
    <title></title>
    <!-- Meta tag Keywords -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords"
          content="Event Register Form Responsive Widget,Login form widgets, Sign up Web forms , Login signup Responsive web form,Flat Pricing table,Flat Drop downs,Registration Forms,News letter Forms,Elements"/>
    <script type="application/x-javascript">
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        } </script>
    <!-- Meta tag Keywords -->
    <!-- css files -->
    <link rel="stylesheet" href="/static/index/css/style.css" type="text/css" media="all"/> <!-- Style-CSS -->
    <link rel="stylesheet" href="/static/index/css/font-awesome.css"> <!-- Font-Awesome-Icons-CSS -->
    <!-- //css files -->
    <!-- js -->
    <script type="text/javascript" src="/static/index/js/jquery-2.1.4.min.js"></script>
    <script src="/static/index/js/jquery.cookie.js" type="text/javascript"></script>
    <!-- //js -->
</head>
<body>
<!-- main -->
<div data-vide-bg="bg">
    <div class="center-container">
        <div class="w3ls-header">
            <div class="header-main">
                <h1>Login In</h1>
                <div class="header-bottom">
                    <div class="header-right w3agile">
                        <div class="header-left-bottom agileinfo">
                            <form action="{:url('index/login/logindo',['id'=>$id,'type'=>$type])}" method="post" id="submitForm">
                                <div class="icon1">
                                    <i class="fa fa-user" aria-hidden="true"></i>
                                    <input type="text" placeholder="用户名" name="username" id="username" required/>
                                </div>
                                <div class="icon1">
                                    <i class="fa fa-phone" aria-hidden="true" style="border: none; padding: 0;margin: 0;"></i>
                                    <input type="tel" placeholder="手机号码" name="tel" id="tel" required/>
                                </div>
                                <div class="icon1">
                                    <i class="fa fa-lock" aria-hidden="true"></i>
                                    <input type="text" placeholder="验证码" id="yzm" name="yzm" required/>
                                    <button class="yzmbut" data-url="{:url('index/login/goggle')}" type="button"
                                            id="btn">获取验证码
                                    </button>
                                </div>
                                <div class="icon1" hidden="hidden">
                                    <i class="fa fa-lock" aria-hidden="true"></i>
                                    <input type="text" placeholder="验证码" id="yam2" name="yzm2"/>
                                </div>
                                <div class="bottom">
                                    <input type="submit" value="Login"/>
                                </div>
                            </form>
                            <div class="header-left-top">
                                <div class="sign-up"><h2>or</h2></div>

                            </div>
                            <div class="header-social wthree">
                                <ul>
                                    <li><a href="{:url('index/login/email')}" class="f"><i class="fa fa-envelope-o" aria-hidden="true"></i>E-mail</a>
                                    </li>
                                    <li><a href="{:url('index/login/register')}" class="t"><i class="fa fa-hand-o-right" aria-hidden="true"></i>Register</a></li>
                                    <li><a href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=101453836&redirect_uri=http://www.qiuzihao.top/index/Login/qqLogin" class="g"><i class="fa" aria-hidden="true"><img src="/static/index/images/Connect_logo_1.png" class="qq"></i>QQ登录</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--header end here-->
        <!-- copyright start here -->
        <div class="copyright">
            <p>
                If we can only encounter each other rather than stay with each other,then I wish we had never
                encountered.
            </p>
            <p>
                如果只是遇见，不能停留，不如不遇见。
            </p>
        </div>
        <!--copyright end here-->
    </div>
</div>
<script>
    $.cookie('time', 60);
    $('#btn').click(function () {

        var rand = Math.floor(Math.random() * 100000 + 1);
        var tel = $('#tel').serialize();
        var info = 'tel' + '=' + document.getElementById('tel').value + '&' + 'rand' + '=' + rand;
        $('#yam2').val(rand);
        console.log(rand);
        if ($('#username').val() == ''){
            alert('用户名不能为空');
            return;
        }
        if ($('#tel').val() == ''){
            alert('电话号码不能为空');
            return;
        }

        if ($.cookie("time") != undefined && $.cookie("time") != 'NaN' && $.cookie("time") != 'null') {
            showbtn();
        } else {
            $('#btn').attr("disabled", false);
        }



        //        $.ajax({
        //            type: 'post',
        //            url: '/index/login/goggle',
        //            data: info,
        //            dataType: 'json',
        //            success: function (data) {
        //            },
        //            error: function () {
        //            }
        //        });
    });

    var totals = $.cookie('time');

    function showbtn() {
        $('#btn').attr('disabled', true);
        if (totals <= 0) {
            $('#btn').removeAttr('disabled');
            $('#btn').html('获取验证码');
            totals = 60;
            return;
        }
        $('#btn').html('请稍后(' + totals + ')');
        totals--;
        $.cookie("time", totals);
        setTimeout("showbtn()", 1000);
    }
</script>
</body>
</html>